package com.teamclub.erp.scontrollers

import com.teamclub.erp.sforms.StorageInfoForm
import com.teamclub.erp.sservices.StorageInfoService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}

/**
  * Created by ilkkzm on 17-9-11.
  */
@RestController("com.teamclub.erp.scontrollers.StorageInfoController")
@RequestMapping(Array("/erp/storageinfo"))
class StorageInfoController {
  @Autowired
  var storageInfoService: StorageInfoService = _

  @PostMapping(Array("list"))
  def list(@RequestBody form: StorageInfoForm) = {
    Eithers.toJson(storageInfoService.list(form))
  }
  @PostMapping(Array("backList"))
  def backList(@RequestBody form: StorageInfoForm) = {
    Eithers.toJson(storageInfoService.backList(form))
  }
  @PostMapping(Array("add"))
  def add(@RequestBody form: StorageInfoForm) = {
    Eithers.toJson(storageInfoService.add(form))
  }
}
